package com.etc.controller;

import com.etc.entity.RoomInfo;
import com.etc.service.RoomService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("/RoomController")
public class RoomController {

    @Autowired
    RoomService service;

    /**
     * 查询所有房间信息
     * @return
     */
    @RequestMapping("/getAllRoomInfo")
    @ResponseBody
    public List<RoomInfo> getAllRoomInfo(){
        //调用业务层
        List<RoomInfo> list = service.getAllRoomInfo();
        return list;
    }
}
